<?php
/**
 * Course Class Model
 *
 * Copyright 2012
 * @date 21-April-2012
 * @author 
 * @version 0.0.1
 **/
class Answer extends AppModel {
/**
 * Name
 *
 * @var string
 */
    public $name = 'Answer';
    public $useTable = "answers";
    
    public static function get_answers_by_questions($customer_id) {
        $ans = ClassRegistry::init("Answer");
        $options= $ans->find("all",array('conditions'=>array('question_id'=>$customer_id)));
        $return = array();
        foreach ($options as $value) {
            $return[]=$value['Answer']['option_id'];
        }
        return $return;
    }
    
    public function delete_answers_by_question($customer_id) {
        return $this->query("Delete from {$this->useTable} where question_id=$customer_id");
    }
}